package com.youseu.taoliving.commodity.web;

import com.youseu.common.utils.PageUtils;
import com.youseu.taoliving.commodity.entity.SkuInfoEntity;
import com.youseu.taoliving.commodity.service.SkuInfoService;
import com.youseu.taoliving.commodity.vo.SearchResult;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import sun.applet.Main;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author Tao
 * @version 1.0
 */
@Controller
public class SearchController {

    @Resource
    private SkuInfoService skuInfoService;
    @RequestMapping("/list.html")
    public String searchList(@RequestParam Map<String,Object> params,
                             Model model,
                             HttpServletRequest httpServletRequest){
        SearchResult searchResult = skuInfoService.queryPageByUserCondition(params);

        //将搜索结果添加到model
        model.addAttribute("result",searchResult);


        return "list";
    }
}
